import { defineStore } from 'pinia'


interface StateType {
  messages: object
}


export const useStoreTemplate = defineStore('storeTemplate', {
  state: (): StateType => ({
    messages: null
  }),

  getters: {
    getSocketMessage: (state): StateType => state,
  },
  actions: {
    // 新增接收消息的动作
    handleSocketMessage(event: StateType) {
      this.messages = event;
    },
  }
})
